Skip to main content

UpdateAllTOF

Updates all tables of figures in the current document.

Syntax

expression.UpdateAllTOF(bOnlyPageNumbers);

expression - A variable that represents a ApiDocument class.

Parameters

NameRequired/OptionalData typeDefaultDescription
bOnlyPageNumbersOptionalbooleanfalseSpecifies that only page numbers will be updated.

Returns

This method doesn't return any data.

Example

This example updates all tables of figures in the current document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let chart = Api.CreateChart("bar3D", [
[200, 240, 280],
[250, 260, 280]
], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);
chart.SetVerAxisTitle("USD In Hundred Thousands", 10);
chart.SetHorAxisTitle("Year", 11);
chart.SetLegendPos("bottom");
chart.SetShowDataLabels(false, false, true, false);
chart.SetTitle("Financial Overview", 13);
paragraph.AddDrawing(chart);
paragraph.AddCaption(" - Financial Overview", "Figure", false, "Arabic", false, undefined, "hyphen");
let tofPr = {"ShowPageNums": true, "RightAlgn": true, "LeaderType": "dot", "FormatAsLinks": true, "BuildFrom": "Figure", "LabelNumber": true, "TofStyle": "distinctive"};
doc.AddTableOfFigures(tofPr);
paragraph = Api.CreateParagraph();
let fill = Api.CreateSolidFill(Api.CreateRGBColor(104, 155, 104));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let drawing = Api.CreateShape("rect", 3212465, 963295, fill, stroke);
paragraph.AddDrawing(drawing);
doc.AddElement(2, paragraph);
paragraph.AddCaption(" - Sample shape", "Figure", false, "Arabic", false, undefined, "hyphen");
doc.UpdateAllTOF(false);